<template>
  <div class="home-container">
    <div class="card-list">
      <div class="card-item" v-for="(item, index) in cardList" :key="index">
        <el-card :body-style="{ padding: '0px', height: '100%' }">
          <img :src="item.imgUrl" class="image">
          <div style="padding: 14px;">
            <span>{{ item.label }}</span>
            <div class="bottom clearfix">
              <time class="time">{{ item.time }}</time>
              <el-button type="text" class="button">操作按钮</el-button>
            </div>
          </div>
        </el-card>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      cardList: [
        { id: 1, label: '好吃的汉堡', time: new Date(), imgUrl: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png' },
        { id: 2, label: '好吃的汉堡', time: new Date(), imgUrl: 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png' },
      ],
    };
  },
  created() {
  },
  methods: {
  },
};
</script>

<style lang="scss" scoped>
.home-container {
  width: 100%;
  height: 100%;

  .card-list {
    width: 100%;
    height: 200px;
    display: flex;
    margin: 0 -6px;

    .card-item {
      flex: 0 1 auto;
      width: 25%;
      height: 100%;
      padding: 0 6px;

      .image {
        width: 100%;
        display: block;
      }
    }
  }
}

.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both
}
</style>
